import {Ref, ref, UnwrapRef} from "vue";
import {LoginUser, LoginRules} from "@/common/interface/login.ts";

// 登录信息
export const loginUser: Ref<UnwrapRef<LoginUser>> = ref<LoginUser>({
    userName: "",
    password: ""
})

// 表单校验规则
export const loginRules: Ref<UnwrapRef<LoginRules>> = ref<LoginRules>({
    userName: [{required: true, message: '账号不能为空', trigger: 'blur'}],
    password: [
        {required: true, message: '密码不能为空', trigger: 'blur'},
        {min: 6, max: 30, message: '密码长度为6~30个字符', trigger: 'blur'}]
})